package com.bw.zg3.Cate.New

import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import androidx.lifecycle.lifecycleScope
import com.alibaba.android.arouter.facade.annotation.Route
import com.blankj.utilcode.util.ToastUtils
import com.bw.base.entity.NewEntityResultItem
import com.bw.base.mvvm.BaseActivity
import com.bw.zg3.R
import com.bw.zg3.databinding.ActivityNewBinding
import dagger.hilt.android.AndroidEntryPoint
import kotlinx.coroutines.launch

@AndroidEntryPoint
@Route(path="/app/NewActivity")
class NewActivity : BaseActivity<ActivityNewBinding,NewViewModel>() {
      val newApter by lazy { NewApter() }
    override fun initView() {
        binding.newrv.apply {
            adapter=newApter
        }
       lifecycleScope.launch {
           vm.NewResult().collect{
              newApter.submitData(it)
           }
       }
        newApter.setOnItemLongClickListener(object :OnItemLongClickListener{
            override fun onItemLongClick(item: NewEntityResultItem): Boolean {
              ToastUtils.showLong("feafaef")
                return true
            }

        })
    }

    override fun intiData() {

    }
}